package com.geeguo.ebuilder.operation.business.tenant.clientwebmodule.model;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
public class ClientWebModuleVO {

    @Schema(title = "主键")
    private String id;
    @Schema(title = "父级Id")
    private String parentId;
    @Schema(title = "名称")
    private String name;
    @Schema(title = "标题")
    private String title;
    @Schema(title = "类型")
    private Integer type;
    @Schema(title = "层级")
    private Integer depth;
    @Schema(title = "顺序")
    private Integer sequence;
    @Schema(title = "图标")
    private String icon;
    @Schema(title = "访问路径")
    private String  path;
    @Schema(title = "组件")
    private String component;
    @Schema(title = "授权编码")
    private String permissionCode;
    @Schema(title = "是否隐藏（1：是、2：否）")
    private Integer hidden;

    @Schema(title = "子菜单")
    private List<ClientWebModuleVO> children;

    public void addChild(ClientWebModuleVO child) {
        if (children == null) {
            children = new ArrayList<>();
        }
        children.add(child);
    }
}